Skip to content

Conversation

Copy link

Copilot AI commented Dec 18, 2025

The existing MP4 format uses mp4v codec (MPEG-4 Part 2) with interframe compression, making frame-by-frame work impossible. Added MP4 (I-Frame) format for true intraframe encoding.

Changes

  • New format option: "MP4 (I-Frame)" using H.264 with keyint=1:scenecut=0 to force all I-frames
  • VideoBackgroundWorker: Added video_format parameter to pass format context to FFmpeg merge
  • FFmpeg encoding logic: Apply x264 parameters conditionally based on format selection
  • Tests: Added format validation, codec mapping, and intraframe parameter tests with shared constants

Format comparison

Format Encoding Codec Frame Independence
MP4 Interframe mp4v ❌ No
MP4 (I-Frame) Intraframe H.264 ✅ Yes
AVI Intraframe MJPEG ✅ Yes
MKV Intraframe FFV1 ✅ Yes

Implementation

# node_video_writer.py - Format configuration
format_config = {
    'MP4 (I-Frame)': {'ext': '.mp4', 'codec': 'H264'}
}

# video_worker.py - FFmpeg parameters
if video_format == 'MP4 (I-Frame)':
    vcodec = 'libx264'
    vcodec_params = 'keyint=1:scenecut=0'  # All I-frames

Documentation

  • node/VideoNode/README_VideoWriter.md - Format details and use cases
  • node/VideoNode/README_VideoWriter_FR.md - French translation
Original prompt

est ce que je peux faire du frame par frame avec l'option mp4 du videowriter ?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 30 commits December 7, 2025 19:52
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…on-tracker

Add hand tracking node for MediaPipe Hands pose estimation
- Add timestamp preservation in ImageConcat when collecting audio from multiple slots
- Update VideoWriter to synchronize multi-slot audio by timestamp instead of slot order
- Add comprehensive tests validating synchronized audio merging
- Maintain backward compatibility for audio without timestamps

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
- Move traceback import to top of file
- Add detailed comment for float('inf') usage in timestamp sorting
- Remove specific line numbers from documentation to prevent staleness

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
[WIP] Verify synchronized merging of audio chunks
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…Writer

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
… review

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…ssues

Fix audio timestamp loss in Video→SyncQueue→ImageConcat→VideoWriter pipeline
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…ssing

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…orker

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
[WIP] Implement background video creation to avoid UI freezes
…ssue

Fix audio synchronization in VideoWriter multi-slot merging
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…worker

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Copilot AI and others added 18 commits December 17, 2025 11:57
…t option

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Fix YouTube node display failure with playlist URLs
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…nts, and clean up imports

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…ideo-processing

Eliminate cascading deepcopy operations causing memory leak in detection→concat→writer pipeline
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
…sues

Extend H.264 re-encoding fix from AVI to MKV format
- Changed queue size calculation from fps*chunk_duration*audio_queue_size to fps*chunk_duration
- Reduced MAX_FRAME_QUEUE_SIZE from 300 to 100 frames
- Reduced MIN_FRAME_QUEUE_SIZE from 50 to 30 frames
- This prevents excessive memory allocation on start (from ~2.2 GB to ~534 MB at 1080p)
- Added comprehensive test suite to verify memory limits

Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
[WIP] Fix lag issues when starting videowriter
Copilot AI and others added 4 commits December 18, 2025 10:28
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Co-authored-by: hackolite <826027+hackolite@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate frame by frame support in video writer MP4 option Add MP4 intraframe format for frame-by-frame encoding Dec 18, 2025
Copilot AI requested a review from hackolite December 18, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants